<!--
 * @Author: 头部导航栏
 * @Date: 2020-06-08 09:56:37
 * @LastEditTime: 2020-06-11 09:37:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \发明人\fmr\src\components\navBar.vue
--> 
<template>
  <div class="navBar">
    <van-nav-bar title="我是发明人-创新大赛">
      <template #right>
        <van-icon name="wap-nav" size="24" @click="show = true" />
      </template>
    </van-nav-bar>

    <van-popup v-model="show" closeable position="left" :style="{width:'80%',height:'100%'}">
      <div class="popup">
        <div v-for="(item,idx) of titleDatas" :key="idx">
          <div class="popup_list" @click="go(item)">
            <div class="popup_list_t">
              <div class="popup_list_e">{{item.meta.english}}</div>
              <div class="popup_list_c">{{item.meta.title}}</div>
            </div>
          </div>
        </div>
      </div>
    </van-popup>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      titleDatas: [] //标题数据
    };
  },
  methods: {
    go(val) {
      this.$router.push(val.path); //跳转到相应路由
      this.show = false;
    }
  },
  created() {
    this.titleDatas = this.$router.options.routes;
  }
};
</script>

<style lang="scss" scoped>
@import "@/style/navBar.scss"
</style>